<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<link rel="stylesheet" type="text/css" th:href="@{/login/style/register-login.css}">
<body>
<div id="box"></div>
<div class="cent-box">
    <div class="cent-box-header">
        <h1 class="main-title hide">sringboot</h1>
        <h2 class="sub-title">春水初生 - 春林初盛</h2>
    </div>

    <div class="cont-main clearfix">
        <div class="index-tab">
            <div class="index-slide-nav">
                <a href="/login" class="active">登录</a>
                <a href="#">注册</a>
                <div class="slide-bar"></div>
            </div>
        </div>

        <form id="signupForm">
            <div class="login form">
                <div class="group">
                    <div class="group-ipt email">
                        <input type="text" name="email" id="email" class="ipt" placeholder="邮箱地址" required>
                    </div>
                    <div class="group-ipt password">
                        <input type="password" name="password" id="password" class="ipt" placeholder="输入您的登录密码" required>
                    </div>
                    <!--<div class="group-ipt verify">
                        <input type="text" name="verify" id="verify" class="ipt" placeholder="输入验证码" required>
                    </div>-->
                </div>
            </div>

            <div class="button">
                <button type="button" class="login-btn register-btn" id="button">登录</button>
            </div>
        </form>

        <div class="remember clearfix">
            <label class="remember-me"><span class="icon"><span class="zt"></span></span><input type="checkbox" name="remember-me" id="remember-me" class="remember-mecheck" checked>记住我</label>
            <label class="forgot-password">
                <a href="#">忘记密码？</a>
            </label>
        </div>
    </div>
</div>

<div class="footer">
    <p>青柠 - Lime</p>
    <p>Designed By baojunz & <a href="https://gitee.com/i78911244/springboot">gitee</a> 2018</p>
</div>

<script th:src="@{login/js/jquery.min.js}" type="text/javascript"></script>
<script th:src="@{login/js/particles.js}" type="text/javascript"></script>
<script th:src="@{login/js/background.js}" type="text/javascript"></script>
<script th:src="@{/layui/layui.all.js}"></script>

<script>
    $("#remember-me").click(function(){
        var n = document.getElementById("remember-me").checked;
        if(n){
            $(".zt").show();
        }else{
            $(".zt").hide();
        }
    });

    $("#button").click(function () {
        $.ajax({
            type: "POST",
            url: "/login/ajaxLogin",
            data: $('#signupForm').serialize(),
            success: function (r) {
                if (r.code == 0) {
                    parent.location.href = "/login/user";
                } else {
                    layer.msg(r.msg);
                }
            }
        });
    });

</script>
</body>
</html>